﻿@model Example6.MvcWebApp.Sharding.Models.HybridShardingTenantDto

@{
    ViewData["Title"] = "Move database";
}

<h1>Move @Model.TenantName to another database</h1>

<hr />
<div class="row">
    <div class="col-md-4">
        <form asp-action="MoveDatabase">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>

            @Html.HiddenFor(x => x.TenantId)

            <div class="form-group">
                @Html.LabelFor(model => model.ShardingName, new { @class = "col-sm-2 col-form-label" })
                <div class="col-sm-10">
                    @Html.DropDownListFor(m => m.ShardingName, 
                        new SelectList(Model.AllShardingEntries))
                </div>
            </div>
            <div class="form-group form-check">
                <label class="form-check-label">
                    <input class="form-check-input" asp-for="HasOwnDb" /> @Html.DisplayNameFor(model => model.HasOwnDb)
                </label>
            </div>
            <div class="form-group">
                <input type="submit" value="Move" class="btn btn-primary" />
            </div>
        </form>
    </div>
</div>

<div>
    <a asp-action="Index">Back to List</a>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
